home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_02_11 / 2n11066a < prev    next >
Text File  |  1991-09-07  |  473b  |  26 lines

  1. /*
  2.  * Check for NetWare connection
  3.  * (written for Borland C)
  4.  */
  5.  
  6. #include <stdio.h>
  7. #include <dos.h>
  8.  
  9. struct REGPACK r;      /* make 80x86 registers available */
  10.  
  11. int main(void)
  12. {
  13.   r.r_ax = 0xDC00;
  14.   intr(0x21,&r);       /* Get connection number */
  15.  
  16.   if ((r.r_ax & 0x00FF) > 0)
  17.     printf("You have NetWare connection #%d.\n",(r.r_ax & 0x00FF));
  18.   else
  19.   {
  20.     puts("You're not logged in to a NetWare LAN.");
  21.     return(1);
  22.   }
  23.  
  24.   return(0);
  25. }
  26.